import http from '@/plugins/aixos'
import { otherModel } from '@/types/model'

export const addOther = (data: otherModel) => {
  return http.request<otherModel>({
    url: '/other/',
    data,
    method: 'POST',
  })
}

export const findAllOther = (args = {}) => {
  const url =
    '/other?' +
    Object.entries(args)
      .map(([key, value]) => `${key}=${value}`)
      .join('&')
  return http.request<otherModel[]>({
    url,
    method: 'GET',
  })
}

export const delOthers = (id: number) => {
  return http.request({
    url: `/other/others/${id}`,
    method: 'DELETE',
  })
}
